const Router = require('koa-router');
const { uploadImage, getImage, getImageList, delImage } = require('../controllers/upload');
const plottingController = require('../controllers/plotting');

const { getLayer, setLayer } = require('../controllers/layer/layer');
const { getTask, getRef } = require('../controllers/testcontroller');

const fu = require('../controllers/fileupload');

const fss = require('../controllers/filesel');

const router = new Router({
  prefix: '/api'

});

// 上传文件接口
router.post('/fileupload', fu.uploadImage);

router.get('/foldselect', fss.fileselect);



// 上传图片
// 获取图片
router.post('/upload', uploadImage);
router.get('/images/:id', getImage);
router.get('/imageslist', getImageList);
router.delete('/images/:id', delImage);


// 图层相关

router.post('/layer', setLayer);
router.get('/layer', getLayer);


// API Log routes
const apiLogController = require('../controllers/apiLogController');
router.get('/api-logs', apiLogController.getApiLogs);

// 街景相关
const apiLogController = require('../jjcontrollers/filedbController');
router.get('/api-logs', apiLogController.getApiLogs);





module.exports = router;